var colorArr =[
    {
        name:"天王盖地虎",
        a1 : "#7bb6f9",
        a2 : "#0a76ef",
        num:40
    },
    {
        name:"宝塔镇河妖",
        a1 : "#eeb565",
        a2 : "#ef7e04",
        num:60
    },
    {
        name:"好嗨哟",
        a1 : "#cff770",
        a2 : "#86b201",
        num:82
    },
    {
        name:"鬼刀一开看不见",
        a1 : "#76efe5",
        a2 : "#06a0cd",
        num:99
    },
    {
        name:"我信你个鬼",
        a1 : "#8e7af4",
        a2 : "#4050ea",
        num:285
    },
    {
        name:"来了老弟",
        a1 : "#5bf4eb",
        a2 : "#038981",
        num:10
    }
];

var bb = document.getElementById('y_tu').getElementsByTagName('li');
var color1 = null,color2 = null,name1 = null;
for (var i = 0; i < bb.length; i++) {
    color2 = colorArr[i].a1;
    color1 = colorArr[i].a2;
    name1 = colorArr[i].name;
    num1 = colorArr[i].num;
    option = {
        "title": {
            "text": name1,
            "top": '80%',
            "left": 'center',
            "textStyle": {
                "fontSize": 16,
                //"fontWeight": "bold",
                "color": "#333333"
            }
        },
        "tooltip": {
            "trigger": 'item',
            "formatter": "{a} : ("+num1+")人"
            //"formatter": 84
        },
        "series": [
            {
                "name": name1,
                //"name": option.title.text,
                "center": [
                    "50%",
                    "40%"
                ],
                "radius": [
                    "49%",
                    "50%"
                ],
                "clockWise": false,
                "hoverAnimation": false,
                "type": "pie",
                "data": [
                    {
                        "value": num1,
                        "name": "",
                        "label": {
                            "normal": {
                                "show": true,
                                "formatter": num1+ '人',
                                "textStyle": {
                                    "fontSize": 20
                                   // "fontWeight": "normal"
                                },
                                "position": "center"
                            }
                        },
                        "labelLine": {
                            "show": false
                        },
                        "itemStyle": {
                            "normal": {
                                "color": "#333333",
                                "borderColor": new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                    offset: 0,
                                    //color: '#00a2ff'  //gg
                                    color: color1
                                },
                                    {
                                        offset: 1,
                                        //color: '#70ffac' //gg
                                        color: color2
                                    }]),
                                "borderWidth": 10
                            },
                            "emphasis": {
                                "color": "#333333",
                                "borderColor": new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                    offset: 0,
                                    color: '#85b6b2'
                                }, {
                                    offset: 1,
                                    color: '#6d4f8d'
                                }]),
                                "borderWidth": 10
                            }
                        }
                    },
                    {
                        "name": " ",
                        "value": 16,
                        "itemStyle": {
                            "normal": {
                                "label": {
                                    "show": false
                                },
                                "labelLine": {
                                    "show": false
                                },
                                "color": 'rgba(0,0,0,0)',
                                "borderColor": 'rgba(0,0,0,0)',
                                "borderWidth": 0
                            },
                            "emphasis": {
                                "color": 'rgba(0,0,0,0)',
                                "borderColor": 'rgba(0,0,0,0)',
                                "borderWidth": 0
                            }
                        }
                    }

                ]
            },

            {
                "name": name1,
                "center": [
                    "50%",
                    "40%"
                ],
                "radius": [
                    "59%",
                    "60%"
                ],
                "clockWise": false,
                "hoverAnimation": false,
                "type": "pie",
                "data": [
                    {
                        "value": 84,
                        "name": "",
                        "label": {
                            "normal": {
                                "show": true,
                                "formatter": '',
                                "textStyle": {
                                    "fontSize": 20
                                    //"fontWeight": "bold"
                                },
                                "position": "center"
                            }
                        },
                        "labelLine": {
                            "show": false
                        },
                        "itemStyle": {
                            "normal": {
                                "color": "#333333",
                                "borderColor": new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                    offset: 0,
                                    //color: '#00a2ff'  //gg
                                    color: color1
                                }, {
                                    offset: 1,
                                    //color: '#70ffac'  //gg
                                    color: color2
                                }]),
                                "borderWidth": 1
                            },
                            "emphasis": {
                                "color": "#333333",
                                "borderColor": new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                    offset: 0,
                                    color: '#85b6b2'
                                }, {
                                    offset: 1,
                                    color: '#6d4f8d'
                                }]),
                                "borderWidth": 1
                            }
                        }
                    },
                    {
                        "name": " ",
                        "value": 16,
                        "itemStyle": {
                            "normal": {
                                "label": {
                                    "show": false
                                },
                                "labelLine": {
                                    "show": false
                                },
                                "color": 'rgba(0,0,0,0)',
                                "borderColor": 'rgba(0,0,0,0)',
                                "borderWidth": 0
                            },
                            "emphasis": {
                                "color": 'rgba(0,0,0,0)',
                                "borderColor": 'rgba(0,0,0,0)',
                                "borderWidth": 0
                            }
                        }
                    }]
            }
        ]
    };
    var myChart = echarts.init(bb[i]);
    myChart.setOption(option);
}


